<html>
 <head>
  <link href="./leetcode-problem.css" rel="stylesheet" type="text/css">
 </head>
 <body>
  <div class="question_difficulty">
   难度：Medium
  </div>
  <div>
   <h1 class="question_title">
    378. Kth Smallest Element in a Sorted Matrix
   </h1>
   <p>
    Given a
    <i>
     n
    </i>
    x
    <i>
     n
    </i>
    matrix where each of the rows and columns are sorted in ascending order, find the kth smallest element in the matrix.
   </p>
   <p>
    Note that it is the kth smallest element in the sorted order, not the kth distinct element.
   </p>
   <p>
    <b>
     Example:
    </b>
   </p>
   <pre>
matrix = [
   [ 1,  5,  9],
   [10, 11, 13],
   [12, 13, 15]
],
k = 8,

return 13.
</pre>
   <p>
    <b>
     Note:
    </b>
    <br>
    You may assume k is always valid, 1 &le; k &le; n
    <sup>
     2
    </sup>
    .
   </p>
  </div>
  <div>
   <h1 class="question_title">
    378. 有序矩阵中第K小的元素
   </h1>
   <p>
    给定一个&nbsp;
    <em>
     n x n&nbsp;
    </em>
    矩阵，其中每行和每列元素均按升序排序，找到矩阵中第k小的元素。
    <br>
    请注意，它是排序后的第k小元素，而不是第k个元素。
   </p>
   <p>
    <strong>
     示例:
    </strong>
   </p>
   <pre>
matrix = [
   [ 1,  5,  9],
   [10, 11, 13],
   [12, 13, 15]
],
k = 8,

返回 13。
</pre>
   <p>
    <strong>
     说明:
    </strong>
    <br>
    你可以假设 k 的值永远是有效的, 1 &le; k &le; n
    <sup>
     2&nbsp;
    </sup>
    。
   </p>
  </div>
 </body>
</html>